package com.ecb.business.service.impl;

import com.ecb.business.po.ChainAuditPO;
import com.ecb.business.repository.ChainAuditDao;
import com.ecb.business.service.AuditService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AuditServiceImpl implements AuditService {

    @Autowired
    ChainAuditDao chainAuditDao;

    @Override
    public boolean addAudit(String operateType, String operateTarget, String operateUser, String oldData, String newData){
        ChainAuditPO chainAuditPO = new ChainAuditPO();
        chainAuditPO.setOperateType(operateType);
        chainAuditPO.setOperateTarget(operateTarget);
        chainAuditPO.setCreateUser(operateUser);
        chainAuditPO.setDataOld(oldData);
        chainAuditPO.setDataNew(newData);
        chainAuditDao.save(chainAuditPO);
        return true;
    }

}
